<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新增角色</title>
    <link rel="stylesheet" href="/js/bootstrap.min.css">
    <script src="/js/jquery-3.2.1.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#button").click(function () {
                var newRole = $("#addFrom form")[0];
                var formaDate = new FormData(newRole);
                $.ajax({
                    url: "/applets/role/add",
                    type: "post",
                    data: formaDate,
                    contentType: false,
                    processData: false,
                    success: function (data) {
                        alert(data.msg);
                    }
                });
                return false;
            });
        });
    </script>
</head>
<body>

<div class="container" id="addFrom">
    <h2 class="text-center">角色添加</h2>

    <!--导航-->
    <ul class="nav nav-tabs">
        <li class="nav-item">
            <a class="nav-link active" href="/KRole/ShowRole.html">返回展示界面</a>
        </li>
    </ul>

    <form action="#" method="post">
        <div class="form-group">
            <label>角色名</label>
            <input type="text" class="form-control" name="rolename">
        </div>
        <div class="form-group">
            <label>角色描述</label>
            <input type="text" class="form-control" name="roledesc">
        </div>
        <div class="form-group">
            <label>是否可用</label>
            <label class="radio-inline"><input type="radio" name="inuse" value="1">是</label>
            <label class="radio-inline"><input type="radio" name="inuse" value="0">否</label>
        </div>
        <div class="form-group">
            <input type="button" id="button" class="form-control" value="提交">
        </div>
    </form>
</div>
</body>
</html>